home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / comm / xeno / bgbbs02.lha / BGBBS / BGBBS.REXX < prev    next >
OS/2 REXX Batch file  |  1996-11-10  |  23KB  |  926 lines

  1. /****************************************************************************/
  2. /*                                                                          */
  3. /*  BGBBS.REXX  -   Oh well Xenolink is in need of a new BBS lister so here */
  4. /*      V0.2        it is. As XBBSLister hasn't been updated in yonks I     */
  5. /* 10th November 96 thought I'd knock a new BBS lister up, hope you like it */
  6. /*                                                                          */
  7. /* (C)1996 Ben Gaunt Sysop: Channel X BBS +44 (0)181 943 5187               */
  8. /*                     AKA: BenG OR Madness on IRC                          */
  9. /*                    Fido: 2:254/260.12                                    */
  10. /*                  e-mail: ben.gaunt@pickled.demon.co.uk                   */
  11. /*                                                                          */
  12. /* NEEDS:  T: to be assigned  (assign T: RAM:T) its in most start ups ;)    */
  13. /*                                                                          */
  14. /****************************************************************************/
  15.  
  16. /* Arguments:   BGBBS.REXX [NODE_NUMBER] */
  17.  
  18. /*************************************************************************/
  19. /* I BEN GAUNT THE PROGRAMER OF THIS BBS LISTER REQUESTS THAT YOU DO NOT */
  20. /* ALTER THE LINE DISPLAYING MY BBS NUMBER. AFTER ALL THIS DOOR IS       */
  21. /* FREEWARE AND IT WOULD BE NICE FOR ME TO GET A REWARD OF A FEW NEW     */
  22. /* USERS FOR MY TROUBLES. BUT IF YOU REALY DONT WANT TO HAVE MY NUMBER   */
  23. /* THERE FEEL FREE TO REMOVE IT, IT WOULD BE NICE IF YOU WOULD KEEP IT   */
  24. /* THERE THOUGH ;)                                                       */
  25. /*************************************************************************/
  26.  
  27. OPTIONS RESULTS
  28. arg Node_Number
  29. Signal on error
  30. signal on syntax
  31. signal on IOERR
  32. PortName = 'XenolinkRexxPort'Node_Number
  33. GetUserVar Name
  34. nicename result
  35. uname$ = result
  36. GetUserVar Privilege
  37. alevel = result
  38.  
  39. GetUserVar PageLength
  40. plength = result
  41. dplength = plength - 8
  42.  
  43. Getvar 8
  44. menuset=result
  45.  
  46. /* ======================================================================== */
  47. /*  <<< CONFIGURATION >>>   <<< CONFIGURATION >>>   <<< CONFIGURATION >>>   */
  48. /* ======================================================================== */
  49.  
  50. /* THE VALUE [0] BELOW SHOULD BE = TO FIRST MENUSET TO USE ANSI COLOUR */
  51. /* 1 = USE ANSI + COLOUR, 0 = USE ASCII TEXT */
  52.  
  53. if menuset > 0 then do
  54.  _ANSI = 1
  55. end
  56. else do
  57.  _ANSI = 0
  58. end
  59.  
  60.  
  61. /* IF YOU WANT BGBBS IN A DIFFERENT LOCATION CHANGE THE PATH$ TO POINT TO */
  62. /* THE NEW PATH. <<< IMPORTANT >>> THE PATH$ MUST END IN A : OR /         */
  63.  
  64. PATH$="REXX:BGBBS/"
  65.  
  66. /* ======================================================================== */
  67. /*        <<< END CONFIGURATION >>>       <<< END CONFIGURATION >>>         */
  68. /* ======================================================================== */
  69.  
  70. /* SET UP EASY COLOURS ;) */
  71.  RED=''
  72.  GRE=''
  73.  YEL=''
  74.  BLU=''
  75.  PUR=''
  76.  CYA=''
  77.  OFF=''
  78.  
  79. /* ======================================================================== */
  80.  
  81. CLS
  82. message 'Loading BBS data, please wait a moment....'
  83.  
  84. call DATLOAD
  85.  
  86. /* ======================================================================== */
  87.  
  88. MAINMENU:
  89.  
  90. do forever
  91.  
  92.   call BANNER
  93.  
  94.   if _ANSI = 1 then do
  95.     newline
  96.     message RED'                          ['OFF'1'RED']'OFF' View the BBS list'
  97.     message RED'                          ['OFF'2'RED']'OFF' Search BBS list'
  98.     message RED'                          ['OFF'3'RED']'OFF' Download BBS list (ASCII TEXT)'
  99.     message RED'                          ['OFF'4'RED']'OFF' Add a BBS to the list'
  100.     message RED'                          ['OFF'5'RED']'OFF' Delete a BBS from the list'
  101.     message RED'                          ['OFF'6'RED']'OFF' Help'
  102.     newline
  103.     message RED'                          ['OFF'7'RED']'OFF' Exit'
  104.     newline
  105.   end
  106.   else do
  107.     newline
  108.     message '                          [1] View the BBS list'
  109.     message '                          [2] Search BBS list'
  110.     message '                          [3] Download BBS list (ASCII TEXT)'
  111.     message '                          [4] Add a BBS to the list'
  112.     message '                          [5] Delete a BBS from the list'
  113.     message '                          [6] Help'
  114.     newline
  115.     message '                          [7] Exit'
  116.     newline
  117.   end
  118.  
  119.   msg '                            The choice is yours> '
  120.  
  121.   do until choice >0 & choice <8
  122.     getchar
  123.     choice=result
  124.   end
  125.  
  126.   if choice = 1 then do
  127.     call VIEWLIST
  128.   end
  129.  
  130.   if choice = 2 then do
  131.     call SEARCH
  132.   end
  133.  
  134.   if choice = 3 then do
  135.     call DOWN
  136.   end
  137.  
  138.   if choice = 4 then do
  139.     call NEWBBS
  140.   end 
  141.   
  142.   if choice = 5 then do
  143.     call KILL
  144.   end
  145.  
  146.   if choice = 6 then do
  147.     call HELP
  148.   end
  149.  
  150.   if choice = 7 then do
  151.     CLS
  152.     exitscript
  153.   end
  154.  
  155. end
  156.  
  157. /* ======================================================================== */
  158.  
  159. NEWBBS:
  160.  
  161. call BANNER
  162. newline
  163. /* GET BBS DETAILS */
  164. n=totalBBS+1
  165. if _ANSI = 1 then do
  166.   msg GRE'           BBS name:'OFF
  167.   getline 58 normal ' '
  168.   BBS$.n.1 = result
  169.  
  170.   msg GRE'   Telephone number:'OFF
  171.   getline 58 normal ' '
  172.   BBS$.n.2 = result
  173.  
  174.   msg GRE'         Open hours:'OFF
  175.   getline 58 normal ' '
  176.   BBS$.n.3 = result
  177.  
  178.   msg GRE'      Max baud rate:'OFF
  179.   getline 58 normal ' '
  180.   BBS$.n.4 = result
  181.  
  182.   msg GRE'           Location:'OFF
  183.   getline 58 normal ' '
  184.   BBS$.n.5 = result
  185.  
  186.   msg GRE'       BBS Software:'OFF
  187.   getline 58 normal ' '
  188.   BBS$.n.6 = result
  189.  
  190.   msg GRE'       Sysop''s name:'OFF
  191.   getline 58 normal ' '
  192.   BBS$.n.7 = result
  193.  
  194.   msg GRE'      Mail Networks:'OFF
  195.   getline 58 normal ' '
  196.   BBS$.n.8 = result
  197.  
  198.   msg GRE'        Net address:'OFF
  199.   getline 58 normal ' '
  200.   BBS$.n.9 = result
  201.  
  202.   msg GRE'      Email address:'OFF
  203.   getline 58 normal ' '
  204.   BBS$.n.10 = result
  205.  
  206.   msg GRE'Computers supported:'OFF
  207.   getline 58 normal ' '
  208.   BBS$.n.11 = result
  209.  
  210.   msg GRE'      Comment (1/3):'OFF
  211.   getline 58 normal ' '
  212.   BBS$.n.12 = result
  213.  
  214.   msg GRE'      Comment (2/3):'OFF
  215.   getline 58 normal ' '
  216.   BBS$.n.13 = result
  217.  
  218.   msg GRE'      Comment (3/3):'OFF
  219.   getline 58 normal ' '
  220.   BBS$.n.14 = result
  221.  
  222.   message GRE'               Date: 'RED||date()||OFF
  223.   BBS$.n.15 = date()
  224. end
  225. else do
  226.   msg '           BBS name:'
  227.   getline 58 normal ' '
  228.   BBS$.n.1 = result
  229.  
  230.   msg '   Telephone number:'
  231.   getline 58 normal ' '
  232.   BBS$.n.2 = result
  233.  
  234.   msg '         Open hours:'
  235.   getline 58 normal ' '
  236.   BBS$.n.3 = result
  237.  
  238.   msg '      Max baud rate:'
  239.   getline 58 normal ' '
  240.   BBS$.n.4 = result
  241.  
  242.   msg '           Location:'
  243.   getline 58 normal ' '
  244.   BBS$.n.5 = result
  245.  
  246.   msg '       BBS Software:'
  247.   getline 58 normal ' '
  248.   BBS$.n.6 = result
  249.  
  250.   msg '       Sysop''s name:'
  251.   getline 58 normal ' '
  252.   BBS$.n.7 = result
  253.  
  254.   msg '      Mail Networks:'
  255.   getline 58 normal ' '
  256.   BBS$.n.8 = result
  257.  
  258.   msg '        Net address:'
  259.   getline 58 normal ' '
  260.   BBS$.n.9 = result
  261.  
  262.   msg '      Email address:'
  263.   getline 58 normal ' '
  264.   BBS$.n.10 = result
  265.  
  266.   msg 'Computers supported:'
  267.   getline 58 normal ' '
  268.   BBS$.n.11 = result
  269.  
  270.   msg '      Comment (1/3):'
  271.   getline 58 normal ' '
  272.   BBS$.n.12 = result
  273.  
  274.   msg '      Comment (2/3):'
  275.   getline 58 normal ' '
  276.   BBS$.n.13 = result
  277.  
  278.   msg '      Comment (3/3):'
  279.   getline 58 normal ' '
  280.   BBS$.n.14 = result
  281.  
  282.   message '               Date: 'RED||date()
  283.   BBS$.n.15 = date()
  284. end
  285.  
  286. QUERYN 'Is all the above correct?'
  287. yn$ = result
  288.  
  289. /* IF DATA IS CORRECT ADD IT TO THE BBS LIST DAT FILE */
  290. if yn$ = 'Y' then do
  291.  
  292.   BBS$.n.16 = uname$
  293.   totalBBS=totalBBS+1
  294.  
  295.   newline
  296.   msg 'Adding BBS details to the BBS list......'
  297.   call open(datafile, PATH$||'BGBBS.DAT', 'a')
  298.     call writeln(datafile, BBS$.n.1)
  299.     call writeln(datafile, BBS$.n.2)
  300.     call writeln(datafile, BBS$.n.3)
  301.     call writeln(datafile, BBS$.n.4)
  302.     call writeln(datafile, BBS$.n.5)
  303.     call writeln(datafile, BBS$.n.6)
  304.     call writeln(datafile, BBS$.n.7)
  305.     call writeln(datafile, BBS$.n.8)
  306.     call writeln(datafile, BBS$.n.9)
  307.     call writeln(datafile, BBS$.n.10)
  308.     call writeln(datafile, BBS$.n.11)
  309.     call writeln(datafile, BBS$.n.12)
  310.     call writeln(datafile, BBS$.n.13)
  311.     call writeln(datafile, BBS$.n.14)
  312.     call writeln(datafile, BBS$.n.15)
  313.     call writeln(datafile, BBS$.n.16)
  314.   call close(datafile)
  315.   msg 'done.'
  316. end
  317. /* IF DATA ISNT CORRECT INFORM USER DATA HASNT BEEN ADDED TO THE LIST */
  318. else do
  319.   newline
  320.   message 'Entry aborted BBS details have NOT been added to the list.'
  321.   newline
  322.   msg 'Press any key to continue.'
  323.   getchar
  324. end
  325.  
  326. return
  327.  
  328. /* ======================================================================== */
  329.  
  330. VIEWLIST:
  331.  
  332. call BANNER
  333.  
  334. if _ANSI = 1 then do
  335.   newline
  336.   message GRE'Would you like to see a 'RED'['OFF'S'RED']'GRE'hort quick list or a 'RED'['OFF'F'RED']'GRE'ull detailed list?'OFF
  337.   newline
  338.   msg RED'['OFF's'RED']'GRE'hort/'RED'['OFF'F'RED']'GRE'ull > 'OFF
  339. end
  340. else do
  341.   newline
  342.   message 'Would you like to see a [S]hort quick list or a [F]ull detailed list?'
  343.   newline
  344.   msg '[s]hort/[F]ull > '
  345. end
  346.  
  347. getchar
  348. lview$=result
  349. lview$=upper(lview$)
  350.  
  351. if lview$ = 'S' then do
  352. /* SHORT LISTER */
  353.  
  354.   pause = (plength-8)/5
  355.  
  356. /* do n=1 to totalBBS */
  357. n=0
  358. do until n >= totalBBS
  359.     call banner
  360.     counter = 0
  361.  
  362.     /* KEEP PRINTING THE BBS DATA UNTIL SCREEN IS FULL OR END OF FILE */
  363.     /* HAS BEEN REACHED */
  364.     /* THIS IS VERY VERY VERY MESSY :-/ */
  365.     do until counter >= pause-1 | n = totalBBS
  366.  
  367.       newline
  368.       counter = counter +1
  369.       n=n+1
  370.  
  371.       if _ANSI = 1 then do
  372.         message GRE'           BBS name: 'YEL||BBS$.n.1
  373.         message GRE'   Telephone number: 'OFF||BBS$.n.2
  374.         message GRE'         Open hours: 'OFF||BBS$.n.3
  375.         message GRE'Computers supported: 'OFF||BBS$.n.11
  376.       end
  377.       else do
  378.         message '           BBS name: '||BBS$.n.1
  379.         message '   Telephone number: '||BBS$.n.2
  380.         message '         Open hours: '||BBS$.n.3
  381.         message 'Computers supported: '||BBS$.n.11
  382.       end
  383.     end
  384.  
  385.     newline
  386.     msg '                  Press any key to continue or press Q to quit'
  387.     getchar
  388.     choice$=result
  389.     upper choice$
  390.     if choice$ = 'Q' then do
  391.       n=totalBBS
  392.     end
  393.  
  394.   end
  395.  
  396. end
  397. else do
  398.   /* FULL LISTER */
  399.   do n=1 to totalBBS
  400.     /* DISPLAY THE RECENTLY READ IN DATA */
  401.  
  402.     call banner
  403.  
  404.     /* DISPLAY THE BBS DETAILS */
  405.     call DISPLAYBBS(n)
  406.  
  407.     /* LINE 16 ISNT SHOWN USED IN DEL OPTION */
  408.     
  409.     newline
  410.     msg '                  Press any key to continue or press Q to quit'
  411.     getchar
  412.     choice$=result
  413.     upper choice$
  414.     if choice$ = 'Q' then do
  415.       n=totalBBS
  416.     end
  417.  
  418.   end
  419.  
  420. end
  421.  
  422. return
  423.  
  424. /* ======================================================================== */
  425.  
  426. DOWN:
  427.  
  428. call BANNER
  429. newline
  430. message 'Generating ASCII text file from the BBS lister data, please wait...'
  431. newline
  432.  
  433. call open(introdata, PATH$||'INTRO.TXT', 'R')
  434. call open(enddata, PATH$||'END.TXT', 'R')
  435.  
  436. call open(ASCII, 'T:BBS_LIST.TXT', 'W')
  437.  
  438. /* COPY INTRO TEXT TO ASCII FILE */
  439. do until eof(introdata)
  440.   aline$ = readln(introdata)
  441.   call writeln(ASCII, aline$)
  442. end
  443.  
  444. /* WRITE BBS LIST TO ASCII FILE */
  445. do n=1 to totalBBS
  446.   call writeln(ASCII, '           BBS name: '||BBS$.n.1)
  447.   call writeln(ASCII, '   Telephone number: '||BBS$.n.2)
  448.   call writeln(ASCII, '         Open hours: '||BBS$.n.3)
  449.   call writeln(ASCII, '      Max baud rate: '||BBS$.n.4)
  450.   call writeln(ASCII, '           Location: '||BBS$.n.5)
  451.   call writeln(ASCII, '       BBS Software: '||BBS$.n.6)
  452.   call writeln(ASCII, '       Sysop''s name: '||BBS$.n.7)
  453.   call writeln(ASCII, '      Mail Networks: '||BBS$.n.8)
  454.   call writeln(ASCII, '        Net address: '||BBS$.n.9)
  455.   call writeln(ASCII, '      Email address: '||BBS$.n.10)
  456.   call writeln(ASCII, 'Computers supported: '||BBS$.n.11)
  457.   call writeln(ASCII, '            Comment: '||BBS$.n.12)
  458.   call writeln(ASCII, '                     '||BBS$.n.13)
  459.   call writeln(ASCII, '                     '||BBS$.n.14)
  460.   call writeln(ASCII, 'Date placed on list: '||BBS$.n.15)
  461.   call writeln(ASCII, '')
  462.   call writeln(ASCII, '----------------------------------------------------------------------------')
  463.   call writeln(ASCII, '')
  464. end
  465.  
  466. /* COPY END TEXT TO ASCII FILE */
  467. do until eof(enddata)
  468.   aline$ = readln(enddata)
  469.   call writeln(ASCII, aline$)
  470. end
  471.  
  472. /* TAG IT ;) */
  473. call writeln(ASCII, '          .----------------------------------------------------------.')
  474. call writeln(ASCII, '          | This file was created with BG-BBS LISTER ©1996 Ben Gaunt |')
  475. call writeln(ASCII, '          |         Another Pickled Fish Software Production!        |')
  476. call writeln(ASCII, '          `----------------------------------------------------------''')
  477.  
  478. call close (ASCII)
  479. call close (introdata)
  480. call close (enddata)
  481.  
  482.   DOWNLOADFILE 'T:BBS_LIST.TXT'
  483.   dl = result
  484.  
  485.   if dl = 1 then do
  486.     message 'Download failed, local download not allowed!'
  487.   end   
  488.  
  489.   if dl = 2 then do
  490.     message 'Download failed, file does not exist?'
  491.   end
  492.  
  493.   if dl = 3 then do
  494.     message 'Download failed, file already marked for downloading!'
  495.   end
  496.  
  497. newline
  498. msg 'Press any key to continue'
  499. getchar
  500.  
  501. return
  502.  
  503. /* ======================================================================== */
  504.  
  505. SEARCH:
  506.  
  507. call banner
  508.  
  509. newline
  510. if _ANSI=1 then do
  511.   Msg GRE'Search on 'RED'['OFF'S'RED']'GRE'ysop name or 'RED'['OFF'B'RED']'GRE'bs name? 'OFF'> '
  512. end
  513. else do
  514.   Msg 'Search on [S]ysop name or [B]bs name? > '
  515. end
  516.  
  517. getchar
  518. choice$=upper(result)
  519.  
  520. /* SEARCH SYSOP NAMES */
  521. if choice$ = 'S' then do
  522.  
  523.   newline
  524.   newline
  525.   msg 'Search for > '
  526.   getline 58 normal
  527.   findme$ = result
  528.   upper findme$
  529.  
  530.   if length(findme$) > 0 then do
  531.  
  532.     do n = 1 to totalBBS
  533.  
  534.       /* RESET THE FOUND FLAG */
  535.       found = 0
  536.  
  537.       /* CHECK FOR MATCH */
  538.  
  539.       sysop$ = upper(BBS$.n.7)
  540.       z=length(sysop$)
  541.       x=length(findme$)
  542.  
  543.       do i = 1 to z
  544.         itsme$ = substr(sysop$,i,x)
  545.  
  546.         if itsme$ = findme$ then do
  547.           found=1
  548.         end
  549.  
  550.       end
  551.  
  552.  
  553.       /* DISPLAY BBS DETAILS IF A MATCH IS FOUND */
  554.       if found = 1 then do
  555.  
  556.         call banner
  557.         newline
  558.         call DISPLAYBBS(n)
  559.         newline
  560.  
  561.         msg '                  Press any key to continue or press Q to quit'
  562.         getchar
  563.         quiter$=result
  564.         upper quiter$
  565.         if quiter$ = 'Q' then do
  566.           n = totalBBS
  567.         end
  568.  
  569.       end
  570.  
  571.     end
  572.  
  573.   end
  574.  
  575. end
  576.  
  577. /* SEARCH BBS NAMES */
  578. if choice$ = 'B' then do
  579.  
  580.   newline
  581.   newline
  582.   msg 'Search for > '
  583.   getline 58 normal
  584.   findme$ = result
  585.   upper findme$
  586.  
  587.   if length(findme$) > 0 then do
  588.  
  589.     do n = 1 to totalBBS
  590.  
  591.       /* RESET THE FOUND FLAG */
  592.       found = 0
  593.  
  594.       /* CHECK FOR MATCH */
  595.  
  596.       sysop$ = upper(BBS$.n.1)
  597.       z=length(sysop$)
  598.       x=length(findme$)
  599.  
  600.       do i = 1 to z
  601.         itsme$ = substr(sysop$,i,x)
  602.  
  603.         if itsme$ = findme$ then do
  604.           found=1
  605.         end
  606.  
  607.       end
  608.  
  609.  
  610.       /* DISPLAY BBS DETAILS IF A MATCH IS FOUND */
  611.       if found = 1 then do
  612.  
  613.         call banner
  614.         newline
  615.         call DISPLAYBBS(n)
  616.         newline
  617.  
  618.         msg '                  Press any key to continue or press Q to quit'
  619.         getchar
  620.         quiter$=result
  621.         upper quiter$
  622.         if quiter$ = 'Q' then do
  623.           n = totalBBS
  624.         end
  625.  
  626.       end
  627.  
  628.     end
  629.  
  630.   end
  631.  
  632. end
  633.  
  634. return
  635.  
  636. /* ======================================================================== */
  637.  
  638. KILL:
  639.  
  640. call banner
  641. newline
  642.  
  643. do n=1 to totalBBS
  644.  
  645.   /* SEE IF USER WISHING TO DELETE HAS ENTERD ANYTHING */
  646.   if BBS$.n.16 = uname$ | alevel = 255 then do
  647.  
  648.     call displaybbs(n)
  649.     newline
  650.     QUERYN 'Delete this BBS record? '
  651.     killme = upper(result)
  652.     
  653.     if killme = 'Y' then do
  654.       
  655.       newline
  656.       msg 'Removing BBS details from list pleas wait...'
  657.    
  658.       call open(datafile, PATH$||'BGBBS.DAT', 'W')
  659.       do a=1 to totalBBS
  660.  
  661.         if a ~= n then do
  662.           call writeln(datafile, BBS$.a.1)
  663.           call writeln(datafile, BBS$.a.2)
  664.           call writeln(datafile, BBS$.a.3)
  665.           call writeln(datafile, BBS$.a.4)
  666.           call writeln(datafile, BBS$.a.5)
  667.           call writeln(datafile, BBS$.a.6)
  668.           call writeln(datafile, BBS$.a.7)
  669.           call writeln(datafile, BBS$.a.8)
  670.           call writeln(datafile, BBS$.a.9)
  671.           call writeln(datafile, BBS$.a.10)
  672.           call writeln(datafile, BBS$.a.11)
  673.           call writeln(datafile, BBS$.a.12)
  674.           call writeln(datafile, BBS$.a.13)
  675.           call writeln(datafile, BBS$.a.14)
  676.           call writeln(datafile, BBS$.a.15)
  677.           call writeln(datafile, BBS$.a.16)
  678.         end
  679.  
  680.       end
  681.       call close(datafile)
  682.  
  683.       call DATLOAD
  684.  
  685.     end
  686.  
  687.     call banner
  688.     newline
  689.  
  690.   end
  691.  
  692. end
  693.  
  694. message 'There are no more BBS records that can be deleted by you.'
  695. newline
  696. message 'If there is a BBS record on here you wish removed please leave a message'
  697. message 'to the Sysop he/she can remove it for you.'
  698. newline
  699. message 'Press any key to continue'
  700. getchar
  701.  
  702. return
  703.  
  704. /* ======================================================================== */
  705.  
  706. HELP:
  707.  
  708. call TEXT(help.txt)
  709.  
  710. return
  711.  
  712. /* ======================================================================== */
  713.  
  714. TEXT:
  715. /* LOAD AND DISPLAY A ASCII TEXT FILE  ARGS [FILENAME] */
  716. arg fname$
  717.  
  718. /* CHECK FILE EXISTS */
  719. if exists(PATH$||fname$) then do
  720.   l = 0
  721.  
  722.   /* OPEN FILE AND READ ALL LINES INTO DYNAMIC ARRAY */
  723.   call open(ASCII_file, path$||fname$, 'r')
  724.   /* RESET FILE POINTER TO BEGINING OF FILE */
  725.   call SEEK(ASCII_file, 0, 'B')
  726.  
  727.   do until EOF(ASCII_file)
  728.     l = l + 1
  729.     ASCIIline$.l = readln(ASCII_file)
  730.   end
  731.  
  732.   /* call close(fname$) */
  733.   call close(ASCII_file)
  734.  
  735.   z=0
  736.   x=0
  737.   cls
  738.   call Banner
  739.   newline
  740.  
  741.   /* DISPLAY THE TEXT ONE SCREEN FULL AT A TIME */
  742.   do a = 1 to l
  743.     message ASCIIline$.a
  744.     z=z+1
  745.     x=x+1
  746.  
  747.     if z = dplength | x = l then do
  748.       z = 0
  749.       newline
  750.       msg '                    [Return] to continue              [Q]uit'
  751.       getchar
  752.       erm = result
  753.  
  754.       /* IF 'Q' SELECTED QUIT THE LOOP */
  755.       if upper(erm) = 'Q' then do
  756.         a = l
  757.       end
  758.       /* IF MORE TEXT TO BE DISPLAYED RE-DRAW TITLE */
  759.       else if a ~= l then do
  760.         cls
  761.         call Banner
  762.         newline
  763. /*        message a' 'l
  764.         message ASCII_file
  765. */
  766.       end
  767.  
  768.     end
  769.  
  770.   end
  771. end
  772. else do
  773.   /* IF FILE WASN'T FOUND DISPLAY ERROR MESSAGE AND CONTINUE */
  774.   cls
  775.   message '< ERROR > Can not find 'PATH$||fname$' file to load!'
  776.   newline
  777.   message 'Press any key'
  778.   getchar
  779. end
  780.  
  781. return
  782.  
  783. /* ======================================================================== */
  784.  
  785. BANNER:
  786.  
  787. CLS
  788. if _ANSI = 1 then do
  789.   message YEL'                    Another Pickled Fish Software Production                   '
  790.   message OFF'                    BG ËÍ» ËÍ» ÉÍ»   Ë   Ë ÉÍ» ÉË» ÉÍ» ËÍ»'
  791.   message CYA'                       Ì͹ Ì͹ ÈÍ»   º   º ÈÍ»  º  ÌÍ  Ì˼'
  792.   message BLU'                       Êͼ Êͼ Èͼ   Èͼ Ê Èͼ  Ê  Èͼ ÊÈÍ V0.2'OFF
  793.   message CYA' Channel X +44 (0)181 943 5187 'YEL'(C)1996 Ben Gaunt'CYA' Channel X +44 (0)181 943 5187 '
  794. end
  795. else do
  796.   message '_____________________Another Pickled Fish Software Production__________________'
  797.   message '                    BG  _  _  _          _  ___  __  _ '
  798.   message '                       |_)|_)|_''  |   | |_''  |  |_  |_|'
  799.   message '                       |_)|_)._|  |__ | ._|  |  |__ | \ V0.2'
  800.   message '_______________________________________________________________________________'
  801. end
  802.  
  803. return
  804.  
  805. /* ======================================================================== */
  806.  
  807. DISPLAYBBS:
  808. arg zx
  809.     if _ANSI = 1 then do
  810.       newline
  811.       message GRE'           BBS name: 'YEL||BBS$.zx.1
  812.       message GRE'   Telephone number: 'OFF||BBS$.zx.2
  813.       message GRE'         Open hours: 'OFF||BBS$.zx.3
  814.       message GRE'      Max baud rate: 'OFF||BBS$.zx.4
  815.       message GRE'           Location: 'OFF||BBS$.zx.5
  816.       message GRE'       BBS Software: 'OFF||BBS$.zx.6
  817.       message GRE'       Sysop''s name: 'OFF||BBS$.zx.7
  818.       message GRE'      Mail Networks: 'OFF||BBS$.zx.8
  819.       message GRE'        Net address: 'OFF||BBS$.zx.9
  820.       message GRE'      Email address: 'OFF||BBS$.zx.10
  821.       message GRE'Computers supported: 'OFF||BBS$.zx.11
  822.       message GRE'            Comment: 'CYA||BBS$.zx.12
  823.       message GRE'                     'CYA||BBS$.zx.13
  824.       message GRE'                     'CYA||BBS$.zx.14
  825.       message GRE'Date placed on list: 'RED||BBS$.zx.15||OFF
  826.     end
  827.     else do
  828.       newline
  829.       message '           BBS name: '||BBS$.zx.1
  830.       message '   Telephone number: '||BBS$.zx.2
  831.       message '         Open hours: '||BBS$.zx.3
  832.       message '      Max baud rate: '||BBS$.zx.4
  833.       message '           Location: '||BBS$.zx.5
  834.       message '       BBS Software: '||BBS$.zx.6
  835.       message '       Sysop''s name: '||BBS$.zx.7
  836.       message '      Mail Networks: '||BBS$.zx.8
  837.       message '        Net address: '||BBS$.zx.9
  838.       message '      Email address: '||BBS$.zx.10
  839.       message 'Computers supported: '||BBS$.zx.11
  840.       message '            Comment: '||BBS$.zx.12
  841.       message '                     '||BBS$.zx.13
  842.       message '                     '||BBS$.zx.14
  843.       message 'Date placed on list: '||BBS$.zx.15
  844.     end
  845.  
  846. return
  847.  
  848. /* ======================================================================== */
  849.  
  850. DATLOAD:
  851. /* SEE IF FILE EXISTS */
  852. if exists(PATH$||'BGBBS.DAT') then do
  853.   i=1
  854.   n=1
  855.   call open(datafile, PATH$||'BGBBS.DAT', 'R')
  856.  
  857.   do until EOF(datafile)
  858.     BBS$.n.i = readln(datafile)
  859.     i=i+1
  860.     if i = 17 then do
  861.       i=1
  862.       n=n+1
  863.     end
  864.   end
  865.  
  866.   call close(datafile)
  867.   totalBBS = n-1
  868. end
  869. else do
  870.   msg 'No data file exists? Making a new one at > '
  871.   msg PATH$||'BGBBS.DAT'
  872.  
  873.   /* OPEN DATA FILE AND ENTER DATA */
  874.   call open(datafile, PATH$||'BGBBS.DAT', 'w')
  875.     call writeln(datafile, 'Channel X BBS')
  876.     call writeln(datafile, '0181 943 5187')
  877.     call writeln(datafile, '24hrs')
  878.     call writeln(datafile, '28800bps')
  879.     call writeln(datafile, 'London, UK')
  880.     call writeln(datafile, 'Xenolink')
  881.     call writeln(datafile, 'Ben Gaunt')
  882.     call writeln(datafile, 'Fido, Barnet etc')
  883.     call writeln(datafile, 'N/A')
  884.     call writeln(datafile, 'ben.gaunt@pickled.demon.co.uk')
  885.     call writeln(datafile, 'Amiga')
  886.     call writeln(datafile, 'An Amiga based BBS that was established in March 1995 and')
  887.     call writeln(datafile, 'still running. Trouble connecting at 28800+ then disable')
  888.     call writeln(datafile, 'Vfc. Whq for MiggyByte disk mag and Pickled Fish Software')
  889.     daet$ = date()
  890.     call writeln(datafile, daet$)
  891.     call writeln(datafile, 'Ben Gaunt')
  892.   call close(datafile)
  893.  
  894.   /* RE-READ THE DATA IN ;) */
  895.   i=1
  896.   n=1
  897.   call open(datafile, PATH$||'BGBBS.DAT', 'R')
  898.  
  899.   do until EOF(datafile)
  900.     BBS$.n.i = readln(datafile)
  901.     i=i+1
  902.     if i = 17 then do
  903.       i=1
  904.       n=n+1
  905.     end
  906.   end
  907.  
  908.   call close(datafile)
  909.   totalBBS = n-1
  910.  
  911. end
  912.  
  913. return
  914.  
  915. /* ======================================================================== */
  916.  
  917. SYNTAX:
  918. /* IF AN SYNTAX ERROR HAPPENS INFORM SYSOP */
  919. CLS
  920. message 'Syntax error in BGBBS...'
  921. message 'Please inform the Sysop.'
  922. message 'Error occured in line:' SIGL 
  923. msg 'Press any key'
  924. getchar
  925. exit
  926.